package com.doitedu.hbase.client;

import com.doitedu.hbase.utils.HbaseUtil;
import org.apache.hadoop.hbase.NamespaceDescriptor;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;

/**
 * @Date 2021/12/13
 * @Created by HANGGE
 * @Description 创建名称空间
 */
public class C07_CreateNS {
    public static void main(String[] args) throws Exception {
        Connection conn = HbaseUtil.getConnection();
        Admin admin = HbaseUtil.getAdmin(conn);
        NamespaceDescriptor.Builder builder = NamespaceDescriptor.create("doit128");
        NamespaceDescriptor namespaceDescriptor = builder.build();
        admin.createNamespace(namespaceDescriptor);



        admin.close();
        conn.close();


    }
}
